<template>
  <div class="detail">
    <!-- 标题 -->
    <h3>{{ detailDate.title }}</h3>
    <!-- 详细 -->
    <div class="source">
      <div class="left">
        <span>发布时间：<em>{{ detailDate.publishTime }}</em></span>
        <span>浏览人数：<em>{{ detailDate.browseNum }}</em></span>
      </div>
      <div class="right">
          <span v-show="detailDate.source">来源：{{ detailDate.source }}</span>
      </div>
    </div>
    <!-- 摘要 -->
    <div class="abstract" v-show="detailDate.intro">
      <p><span>摘要：</span>{{ detailDate.intro }}</p>
      <!-- {{detailDate.content.substring(/"(\S*)"/)[1]}} -->
    </div>
    <div class="img">
          <!-- <img :src="config.pictureUrl +detailDate.cover" alt=""> -->
        </div>
    <div v-html="detailDate.details?detailDate.details:detailDate.abstracts" class="contentHTML"></div>
  </div>
</template>

<script>
// import config from '@/plugins/config.js'

export default {
  props: {
    detailDate: {
      type: Object,
      default: ()=>{}
    }
  },
  head() {
    return {
      title: '中国残疾人康复协会 | '+this.detailDate.title,
      meta: [
        {
          hid: 'author',
          name: 'author',
          content: this.detailDate.author
        },
        {
          hid: 'description',
          name: 'description',
          content: this.detailDate.description
        },
        {
          hid: 'keywords',
          name: 'keywords',
          content: this.detailDate.keywords
        }
      ],
    }
  },
  data(){
    return {
      userInfo: {},
      // config,
      formData:'',
    }
  },
  methods:{
    icom(){
      formData= this.detailDate.content.substr(/"(\S*)"/)[1];
    },
  },
  created(){
  },
  mounted(){
    // this.icom();
  }
}
</script>

<style lang="less" scoped>
.detail {
  padding: 30px 40px;
  min-height: calc(100vh - 200px);;
  h3 {
    font-size: 24px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #333333;
    line-height: 33px;
    margin-bottom: 16px;
    text-align: left;
  }
  .source {
    margin-bottom: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    .left{
      flex: 1;
      span {
        display: inline-block;
        margin-right: 24px;
        font-size: 12px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #999;
        line-height: 17px;
        em{
          color: #333;
        }
      }
    }
    .right{
      display: flex;
      span{
        color: #333;
        margin-left: 32px;
         font-size: 12px;
        font-family: PingFangSC-Regular, PingFang SC;
      }
    }
  }
  .abstract{
    padding: 20px;
    background-color: #F8F8FA;
    p{
      text-align: justify;
      font-size: 14px;
      line-height: 25px;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      // -webkit-line-clamp: ;
      overflow: hidden;
      margin: 0;
    }
  }
  .img{
    width: 666px;
    height: 666px;
    display: none;
    img{
      width: 100%;
    }
  }
  .contentHTML {
    margin-top: 16px;
    /deep/ img {
      margin: 20px 0;
      max-width: 90%;
    }
    /deep/ p,
    /deep/ div,
    /deep/ span {
      line-height: 1.5;
    }
    /deep/ td {
      p,
      div,
      span {
        line-height: 2;
      }
    }
  }
}
</style>